<?php
namespace app\admin\service;

class RuleGroup
{
    /**
     * @var Rule[] $rules
     */
    protected $rules;

    function __construct($rules)
    {
        $this->rules = $rules;
    }

    function check($path)
    {
        foreach($this->rules as $rule){
            if($rule->check($path)){
                return true;
            }
        }
        return false;
    }
}